import os
from multiprocessing import Process, Manager
import numpy as np
import signal
import time
from itertools import product
import subprocess

# parameter analysis for SAGloss

import tool

# step 1
r_e_list = [1.0]
r_p_list = [ 2.5, 10, 20, 40, 60, 80,  100]
enlarge_list = [1.1, 1.6, 2, 10]
perplexity_list = [ 20, 50, 100]
# embdim_list = [200, 400]
embdim_list = [10, 50, 100, 200, 400]
# v_list = [0.003, 0.009, 0.01, 0.05]
v_list = [0.009, 0.01, 0.05]
# dropedgerate_list = [0.00, 0.001, 0.01, 0.05, 0.1]
dropedgerate_list = [0.01, 0.05, 0.1]


cudalist = [
    # 3,
    # 0,
    # 1,
    # 0,
    # 1,
    # 2,
    # 3,
    # 4,
    # 5,
    6,
    7,
]

changeList = [v_list, dropedgerate_list, embdim_list, perplexity_list, enlarge_list, r_e_list, r_p_list]
paramName = ['v', 'dropedgerate', 'embdim', 'perplexity', 'enlarge', "r_e", "r_p", ]
mainFunc = "./main_graph_pumb.py"
ater = tool.AutoTrainer(
    changeList,
    paramName,
    mainFunc,
    deviceList=cudalist,
    poolNumber=2*len(cudalist),
    name="autotrain",
    waittime=60,
)
ater.Run()
